import threading
import time
from queue import Queue

def job(l,q):
    for i in range(len(l)):
        l[i] = l[i]**2
    q.put(l)

def multithreading():
    q = Queue()
    threads = []
    data = [[1,2,3],[4,5,6],[7,8,9]]
    for i in range(3):
        t=threading.Thread(target=job,args=(data[i],q))
        t.start()
        threads.append(t)
    for thread in threads:
        thread.join()
    result = []
    for _ in range(3):
        result.append(q.get())
    print(result)

if __name__ == "__main__":
    multithreading()

'''python的多线程不是平均分配同时运行，每一时刻只有一个确定
线程运行'''